package BankAccount;

import java.util.Random;
import java.util.ArrayList;

public class BankTest {
    public static void main(String[] args) {
        Random r = new Random();
//        String[] accName = {"aaa", "bbb", "ccc", "ddd"};
        double[] balance = new double[30];
        ArrayList<String> accName = new ArrayList<String>();
//        ArrayList<Double> balance = new ArrayList<Double>();
        for (int i = 0; i < 4; i++) {
            accName.add("" + r.nextInt());
            balance[i] = r.nextDouble(0.0, 25000.0);
        }

        accName.add("aaa");
        balance[4] = -159.36;

        Bank bank = new Bank();
        for (int i = 0; i < accName.size() - 1; i++) {
            if (i != 3) bank.opening(accName.get(i), balance[i], r.nextInt(0, 1));
        }

        bank.opening(accName.get(4), balance[4], 1);

        bank.showAccounts();

//        bank.closing("00000000", "aaa");
        bank.closing(bank.getAccount(0));
        bank.showAccounts();

        bank.update();
        bank.getAccount(2).ShowMessages();
    }
}
